/*
 * DirOperations.h
 *
 *  Created on: Apr 8, 2010
 *      Author: Lukasz Spintzyk
 */

#ifndef DIROPERATIONS_H_
#define DIROPERATIONS_H_

#ifndef PH_H_
#include "ph.h"
#endif

namespace CudaCryptoFs {

int readdir(const char *path, void *buf, fuse_fill_dir_t filler,
                        off_t offset, struct fuse_file_info *fi);

int getdir(const char *, fuse_dirh_t, fuse_dirfil_t);

int mkdir(const char *, mode_t);

int rmdir(const char *);

int rename(const char *, const char *);

int opendir(const char *, struct fuse_file_info *);

int releasedir(const char *, struct fuse_file_info *);

int fsyncdir(const char *, int, struct fuse_file_info *);


void fill_with_direntries(boost::shared_ptr<DirectoryIterator> it,
						void* buf,
						fuse_fill_dir_t filler);
void remove_dir_entry_from_directory(boost::shared_ptr<DirectoryIterator> it,
									const std::string& dir_to_del);
}

#endif /* DIROPERATIONS_H_ */
